<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="Webpixels">
    <title>Quick – Website UI Kit (FREE)</title>
    <!-- Preloader -->
    <style>
        @keyframes hidePreloader {
            0% {
                width: 100%;
                height: 100%;
            }
            100% {
                width: 0;
                height: 0;
            }
        }

        body > div.preloader {
            position: fixed;
            background: white;
            width: 100%;
            height: 100%;
            z-index: 1071;
            opacity: 0;
            transition: opacity .5s ease;
            overflow: hidden;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        body:not(.loaded) > div.preloader {
            opacity: 1;
        }

        body:not(.loaded) {
            overflow: hidden;
        }

        body.loaded > div.preloader {
            animation: hidePreloader .5s linear .5s forwards;
        }
    </style>
    <script>
        window.addEventListener("load", function () {
            setTimeout(function () {
                document.querySelector('body').classList.add('loaded');
            }, 300);
        });
    </script>
    <!-- Favicon -->
    <link rel="icon" href="/images/favicon.png" type="image/png">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/css/all.min.css">
    <!-- Quick CSS -->
    <link rel="stylesheet" href="/css/quick-website.css" id="stylesheet">
</head>
<script src="/js/jquery.min.js" type="text/javascript"></script>

<body>
<!-- Preloader -->
<div class="preloader">
    <div class="spinner-border text-primary" role="status">
        <span class="sr-only">Loading...</span>
    </div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="modal-cookies" data-backdrop="false"
     aria-labelledby="modal-cookies" aria-hidden="true">
    <div class="modal-dialog modal-dialog-aside left-4 right-4 bottom-4">
        <div class="modal-content bg-dark-dark">
            <div class="modal-body">
                <!-- Text -->
                <p class="text-sm text-white mb-3">
                    We use cookies so that our themes work for you. By using our website, you agree to our use of
                    cookies.
                </p>
                <!-- Buttons -->
                <a href="pages/utility/terms.html" class="btn btn-sm btn-white" target="_blank">Learn more</a>
                <button type="button" class="btn btn-sm btn-primary mr-2" data-dismiss="modal">OK</button>
            </div>
        </div>
    </div>
</div>
<!-- Go Pro -->
<a href="https://webpixels.io/themes/quick-website-ui-kit"
   class="btn btn-block btn-dark text-truncate rounded-0 py-2 d-none d-lg-block" style="z-index: 1000;" target="_blank">
    <strong>This is a free demo.</strong> Click here to open the full version →
</a>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-light bg-white">
    <div class="container">
        <!-- Brand -->
        <a class="navbar-brand" href="index.html">
            <img alt="Image placeholder" src="assets/img/brand/dark.svg" id="navbar-logo">
        </a>
        <!-- Toggler -->
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse"
                aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <!-- Collapse -->
        <div class="collapse navbar-collapse" id="navbarCollapse">
            <ul class="navbar-nav mt-4 mt-lg-0 ml-auto">
                <li class="nav-item ">
                    <a class="nav-link" href="index.html">Overview</a>
                </li>
                <li class="nav-item dropdown dropdown-animate" data-toggle="hover">
                    <a class="nav-link" href="#" role="button" data-toggle="dropdown" aria-haspopup="true"
                       aria-expanded="false">Pages</a>
                    <div class="dropdown-menu dropdown-menu-single">
                        <a href="index.html" class="dropdown-item">Homepage</a>
                        <a href="about.html" class="dropdown-item">About us</a>
                        <a href="contact.html" class="dropdown-item">Contact</a>
                        <div class="dropdown-divider"></div>
                        <a href="login.html" class="dropdown-item">Login</a>
                    </div>
                </li>
                <li class="nav-item ">
                    <a class="nav-link" href="docs/index.html">Docs</a>
                </li>
            </ul>
            <!-- Button -->
            <a class="navbar-btn btn btn-sm btn-primary d-none d-lg-inline-block ml-3"
               href="https://github.com/webpixels/quick-website-ui-kit-demo/archive/master.zip">
                Download Free
            </a>
            <!-- Mobile button -->
            <div class="d-lg-none text-center">
                <a href="https://webpixels.io/themes/quick-website-ui-kit" class="btn btn-block btn-sm btn-warning">See
                    more details</a>
            </div>
        </div>
    </div>
</nav>
<!-- Main content -->
<section class="slice py-7">
    <div class="container">
        <div class="row row-grid align-items-center">
            <div class="col-12 col-md-5 col-lg-6 order-md-2 text-center">
                <!-- Image -->
                <figure class="w-100">
                    <img alt="Image placeholder" src="/images/illustration-3.svg" class="img-fluid mw-md-120">
                </figure>
            </div>
            <div class="col-12 col-md-7 col-lg-6 order-md-1 pr-md-5">
                <div class="card shadow zindex-100 mb-0">
                    <div class="card-body px-md-5 py-5">
                        <div class="mb-5">
                            <h6 class="h3">Login</h6>
                            <p class="text-muted mb-0">Sign in to your account to continue.</p>
                        </div>
                        <span class="clearfix"></span>
                        <!--登录表单=================================================================-->
                        <form id="login_from" method="post">
                            <div class="form-group">
                                <label class="form-control-label">请输入电话号码</label>
                                <div class="input-group">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><svg xmlns="http://www.w3.org/2000/svg"
                                                                            width="1em" height="1em" viewBox="0 0 24 24"
                                                                            fill="none" stroke="currentColor"
                                                                            stroke-width="2" stroke-linecap="round"
                                                                            stroke-linejoin="round"
                                                                            class="feather feather-user"><path
                                                d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12"
                                                                                                             cy="7"
                                                                                                             r="4"></circle></svg></span>
                                    </div>
                                    <input type="email" class="form-control" name="phone" id="input-phone"
                                           placeholder="name@example.com">
                                </div>
                            </div>
                            <div class="form-group mb-0">
                                <div class="d-flex align-items-center justify-content-between">
                                    <div>
                                        <label class="form-control-label">请输入密码</label>
                                    </div>
                                    <div class="mb-2">
                                        <a href="#" class="small text-muted text-underline--dashed border-primary"
                                           data-toggle="password-text" data-target="#input-password">Show password</a>
                                    </div>
                                </div>
                                <div class="input-group">
                                    <div class="input-group-prepend">
                                        <span class="input-group-text"><svg xmlns="http://www.w3.org/2000/svg"
                                                                            width="1em" height="1em" viewBox="0 0 24 24"
                                                                            fill="none" stroke="currentColor"
                                                                            stroke-width="2" stroke-linecap="round"
                                                                            stroke-linejoin="round"
                                                                            class="feather feather-key"><path
                                                d="M21 2l-2 2m-7.61 7.61a5.5 5.5 0 1 1-7.778 7.778 5.5 5.5 0 0 1 7.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4"></path></svg></span>
                                    </div>
                                    <input type="password" class="form-control" name="password" id="input-password"
                                           placeholder="Password">
                                </div>
                            </div>
                            <div class="mt-4">
                                <button type="button" class="btn btn-block btn-primary" id="submit-btn">登录</button>
                            </div>
                        </form>
                    </div>
                    <div class="card-footer px-md-5"><small>没有 注册?</small>
                        <a th:action="get" href="/register.html" class="small font-weight-bold">创建账户</a></div>
                </div>
                <!-- Buttons -->
                <div class="text-center text-md-left mt-5">
                    <a href="https://webpixels.io/themes/quick-free-bootstrap-theme" class="btn btn-primary btn-icon"
                       target="_blank">
                        <span class="btn-inner--text">Get started</span>
                        <span class="btn-inner--icon"><i data-feather="chevron-right"></i></span>
                    </a>
                    <a href="https://webpixels.io/illustrations"
                       class="btn btn-neutral btn-icon d-none d-lg-inline-block" target="_blank">See Illustrations</a>
                </div>
            </div>
        </div>
    </div>
</section>

<footer class="position-relative" id="footer-main">
    <div class="footer pt-lg-7 footer-dark bg-dark">
        <!-- SVG shape -->
        <div class="shape-container shape-line shape-position-top shape-orientation-inverse">
            <svg width="2560px" height="100px" xmlns="http://www.w3.org/2000/svg"
                 xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="none" x="0px" y="0px"
                 viewBox="0 0 2560 100" style="enable-background:new 0 0 2560 100;" xml:space="preserve"
                 class=" fill-section-secondary">
                    <polygon points="2560 0 2560 100 0 100"></polygon>
                </svg>
        </div>
        <!-- Footer -->
        <div class="container pt-4">
            <div class="row">
                <div class="col-lg-4 mb-5 mb-lg-0">
                    <!-- Theme's logo -->
                    <a href="index.html">
                        <img alt="Image placeholder" src="assets/img/brand/light.svg" id="footer-logo">
                    </a>
                    <!-- Webpixels' mission -->
                    <p class="mt-4 text-sm opacity-8 pr-lg-4">Webpixels attempts to bring the best development
                        experience to designers and developers by offering the tools needed for having a quick and solid
                        start in most web projects.</p>
                    <!-- Social -->
                    <ul class="nav mt-4">
                        <li class="nav-item">
                            <a class="nav-link pl-0" href="https://dribbble.com/webpixels" target="_blank">
                                <i class="fab fa-dribbble"></i>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="https://github.com/webpixels" target="_blank">
                                <i class="fab fa-github"></i>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="https://www.instagram.com/webpxs" target="_blank">
                                <i class="fab fa-instagram"></i>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="https://www.facebook.com/webpixels" target="_blank">
                                <i class="fab fa-facebook"></i>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="col-lg-2 col-6 col-sm-4 ml-lg-auto mb-5 mb-lg-0">
                    <h6 class="heading mb-3">Account</h6>
                    <ul class="list-unstyled">
                        <li><a href="#">Profile</a></li>
                        <li><a href="#">Settings</a></li>
                        <li><a href="#">Billing</a></li>
                        <li><a href="#">Notifications</a></li>
                    </ul>
                </div>
                <div class="col-lg-2 col-6 col-sm-4 mb-5 mb-lg-0">
                    <h6 class="heading mb-3">About</h6>
                    <ul class="list-unstyled">
                        <li><a href="#">Services</a></li>
                        <li><a href="#">Pricing</a></li>
                        <li><a href="#">Contact</a></li>
                        <li><a href="#">Careers</a></li>
                    </ul>
                </div>
                <div class="col-lg-2 col-6 col-sm-4 mb-5 mb-lg-0">
                    <h6 class="heading mb-3">Company</h6>
                    <ul class="list-unstyled">
                        <li><a href="#">Community</a></li>
                        <li><a href="#">Help center</a></li>
                        <li><a href="#">Support</a></li>
                    </ul>
                </div>
            </div>
            <hr class="divider divider-fade divider-dark my-4">
            <div class="row align-items-center justify-content-md-between pb-4">
                <div class="col-md-6">
                    <div class="copyright text-sm font-weight-bold text-center text-md-left">
                        &copy; 2020 <a href="https://webpixels.io" class="font-weight-bold"
                                       target="_blank">Webpixels</a>. All rights reserved
                    </div>
                </div>
                <div class="col-md-6">
                    <ul class="nav justify-content-center justify-content-md-end mt-3 mt-md-0">
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                Terms
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                Privacy
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                Cookies
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</footer>
<!-- Core JS  -->
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/svg-injector.min.js"></script>
<script src="/js/feather.min.js"></script>
<!-- Quick JS -->
<script src="/js/quick-website.js"></script>
<!-- Feather Icons -->
<script>
    feather.replace({
        'width': '1em',
        'height': '1em'
    })
</script>
</body>
<script>
    $(document).ready(function(){
        $("#submit-btn").click(function(){
            var phone = $("#input-phone").val();
            var password = $("#input-password").val();
            /*表单提交前整体校验，验证通过提交表单，验证失败不提交*/
            $.ajax({
                url:'/login',
                type:'POST',
                dataType: 'json',
                data:{phone:phone,password:password},
                success:function(response){
                    console.log(response)
                    if(response.code !== "0"){
                        alert(response.message)
                    }
                    if(response.code === "0"||response.message === "用户已登录"){
                        window.location.href= 'main.html'
                    }
                },
            });
        });
    });
</script>

</html>